Cube Yogi
Cube Yogi
Leader in Zoho Solutions/Consultation

Update associated Deals when Account is modified

Here is our approach to update associated Deals when Account is modified

Our Assumption 

1. We assume that you want to update associated Deals when Account is modified

2. Also we assume that you have some  (Segment 1) field in both Accounts and Deals module

Approach 

We've given the steps to update associated Deals when Account is modified

1. Create workflow to update associated Deals

1.1 Tap on Settings icon

1.2 Tap on "Workflow Rules" under AUTOMATION 

1.3 Tap on "Create Rule"

1.4 Fill all mandatory  fields as mentioned in the image and tap on Next

1.5 Choose "On a record action"

1.6 Choose the following  as mentioned in the image and tap on Next

1.7 Choose 'All Accounts' and tap on Next

1.8 Choose "Function" for Instant Actions 

1.9 Tap on "New Function"

1.10 Choose "Write your own"

1.11 Give Function Name as mentioned in the image

1.12 Tap on "Edit Arguments"

1.13 Choose Param value as mentioned in the image and tap on Save

1.14 Copy  and paste the below Code Snippet and tap on Save

1.16 Tap on "Save"

Code Snippet 

Related Community Question

 Deluge code to update related record | Link

Hi there,
I got this code to update a "Deals" record with "accounts record" when it is edited/created
accDetails = zoho.crm.getRecordById("Accounts",input.accId.toLong());
PotentialDetails = zoho.crm.getRelatedRecords("Deals", "Accounts",input.accId.toLong());

// info PotentialDetails;
PotentialList = list();
for each potential in PotentialDetails {
 // get the potential record
 PotentialId = zoho.crm.getRecordById("Deals", potential.get("id"));
 PotentialList.add(PotentialId.get("id").toLong());
// PotentialList.toLong();
}
info "Potential ID:" + PotentialList;
segment = accDetails.get("Segment1");
info segment;
updatePotentials = zoho.crm.updateRelatedRecord("Potentials", PotentialList.toString(), "Accounts", accId, {"Segment1": "Digital"});
info updatePotentials;
But when I run it it throws and error saying the data is invalid.

So I did this test, 
updatePotentials = zoho.crm.updateRelatedRecord("Deals",773870000022817004,"Accounts",773870000022790023);
info updatePotentials

It still throw an invalid Data.

Got no idea what did i do wrong.
Can someone please help?

Thank you